library ScratchBehindEars initializer init requires LegacySystem

	private function ScratchBehindEarsConditions takes nothing returns boolean
		return GetSpellAbilityId()=='A001'
	endfunction

	private function ScratchBehindEars takes nothing returns nothing
		call CreateItem( 'I006', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()) )
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger()
		call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
		call TriggerAddCondition(t, Condition(function ScratchBehindEarsConditions) )
		call TriggerAddAction(t,function ScratchBehindEars)
	endfunction
endlibrary